<template>
  <div>前往系统设置中..</div>
</template>

<script setup lang="ts" name="basicForm">
import { ElMessage, FormInstance, FormRules, ElNotification } from "element-plus";
import { ref, reactive, onMounted, onBeforeUnmount } from "vue";
import { useRouter } from "vue-router";
import { useTabsStore } from "@/stores/modules/tabs";
import { useUserStore } from "@/stores/modules/user";
import { useKeepAliveStore } from "@/stores/modules/keepAlive";
import { initDynamicRouter } from "@/routers/modules/dynamicRouter";
const router = useRouter();
const userStore = useUserStore();
const tabsStore = useTabsStore();
const keepAliveStore = useKeepAliveStore();

onMounted(() => {
  console.log("aa");
  userStore.setMenuFlag("setting");
  console.log("ssettingsettingsettingsettingsettingsetting");
  // 2.添加动态路由
  initDynamicRouter().then(res => {
    console.log("加载");
    // 3.清空 tabs、keepAlive 数据
    tabsStore.setTabs([]);
    keepAliveStore.setKeepAliveName([]);
    // 4.跳转到首页
    router.push("/jggl");
    // ElNotification({
    //   title: getTimeState(),
    //   message: "已进入系统设置",
    //   type: "success",
    //   duration: 3000
    // });
  });
});
</script>

<style scoped lang="scss">
@import "./index.scss";
.item {
  width: 500px;
}
</style>
